<template>
  <view class="status-bar">
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">🪙</text>
        <text class="status-text">金币</text>
        <text class="status-value">{{ playerGold }}</text>
      </view>
    </view>
    
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">❤️</text>
        <text class="status-text">信任值</text>
        <text class="status-value">{{ playerTrust }}</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar trust-bar" :style="{ width: trustProgressPercent + '%' }"></view>
      </view>
    </view>
    
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">⭐</text>
        <text class="status-text">等级</text>
        <text class="status-value">Lv.{{ playerLevel }}</text>
      </view>
    </view>
    
    <view class="status-item ai-status">
      <view class="status-label">
        <text class="status-icon">🤖</text>
        <text class="status-text">AI信任</text>
        <text class="status-value">{{ Math.floor(aiTrustLevel) }}</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar ai-bar" :style="{ width: aiTrustLevel + '%' }"></view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'GameStatusBar',
  props: {
    playerGold: {
      type: Number,
      default: 0
    },
    playerTrust: {
      type: Number,
      default: 0
    },
    playerLevel: {
      type: Number,
      default: 1
    },
    trustProgressPercent: {
      type: Number,
      default: 0
    },
    aiTrustLevel: {
      type: Number,
      default: 50
    }
  }
}
</script>

<style scoped>
.status-bar {
  display: flex;
  gap: 16rpx;
  padding: 16rpx 20rpx;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12rpx;
  margin: 16rpx 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 8rpx;
  min-width: 120rpx;
  flex: 1;
}

.status-item.ai-status {
  min-width: 140rpx;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 6rpx;
}

.status-icon {
  font-size: 16rpx;
}

.status-text {
  font-size: 12rpx;
  color: #666;
  font-weight: 500;
}

.status-value {
  font-size: 14rpx;
  font-weight: bold;
  color: #333;
  margin-left: auto;
}

.status-progress {
  width: 100%;
  height: 6rpx;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3rpx;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3rpx;
  transition: width 0.3s ease;
}

.trust-bar {
  background: linear-gradient(90deg, #4cd964, #5ac8fa);
}

.ai-bar {
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
}

/* 移动端优化 */
@media (max-width: 768rpx) {
  .status-bar {
    gap: 12rpx;
    padding: 12rpx 16rpx;
    margin: 12rpx 16rpx;
  }
  
  .status-item {
    min-width: 100rpx;
    gap: 6rpx;
  }
  
  .status-item.ai-status {
    min-width: 120rpx;
  }
  
  .status-icon {
    font-size: 14rpx;
  }
  
  .status-text {
    font-size: 10rpx;
  }
  
  .status-value {
    font-size: 12rpx;
  }
  
  .status-progress {
    height: 4rpx;
  }
}
</style>

